package com.leetcode.August;

/**
 * @Description: 、268. 丢失的数字
 * 异或相同为0，与0为本身
 * @Author: Mr.Fxy
 * @CreateTime: 2024-09-05 11:09
 */
public class LC268丢失的数字 {
    public int missingNumber(int[] nums) {
        int sum = nums.length;
        for (int i = 0; i < nums.length; i++) {
            sum = sum ^ i ^ nums[i];
        }
        return sum;
    }
}
